# coding:utf-8
from alipay import AliPay
import os
from alipay import ISVAliPay

RSA_DIR = '/Users/gavinsun/Downloads/RSA签名验签工具_MAC_V3/RSA密钥/'
app_private_key_string = open(os.path.join(RSA_DIR,"应用私钥2048.txt")).read()
alipay_public_key_string = open(os.path.join(RSA_DIR,"应用公钥2048.txt")).read()

# 电脑网站支付，需要跳转到https://openapi.alipay.com/gateway.do? + order_string
alipay = AliPay(
    appid = '2016092500596254',
    app_notify_url = 'http://localhost:8080',
     app_private_key_path=os.path.join(RSA_DIR,"应用私钥2048.txt"),
     alipay_public_key_path= os.path.join(RSA_DIR,"应用公钥2048.txt")
)
order_string = alipay.api_alipay_trade_page_pay(
    out_trade_no="20161112",
    total_amount=0.01,
    subject=subject,
    return_url="https://example.com",
    notify_url="https://example.com/notify"  # 可选, 不填则使用默认notify url
)

